home *** CD-ROM | disk | FTP | other *** search
/ TPUG - Toronto PET Users Group / TPUG Users Group CD / TPUG Users Group CD.iso / CRS / crs54.d81 / sgtool14.arc / SGCTOOLS.DOC < prev    next >
Text File  |  1993-10-04  |  8KB  |  206 lines

  1. ___________________________________________________________________
  2.  
  3.                          SG C Tools 1.4
  4.                     (C) 1993 Steve Goldsmith
  5.                        All Rights Reserved
  6. ___________________________________________________________________
  7.  
  8.  
  9. NOTICE
  10.  
  11. THIS IS NOT FREE SOFTWARE!  If you paid a public domain vendor or
  12. communications service for this product, you paid for the service
  13. of copying or transferring the product, and not for the product
  14. itself.  I guarantee you that nothing ever gets to the originator
  15. of this product from such a sale.  You may evaluate this product,
  16. but if you make use of it, you must register your copy.
  17.  
  18. I offer several incentives for you to register.  First of all,
  19. you receive the most up-to-date copy that I have which is updated
  20. on a regular basis.  Unregistered releases do not include source
  21. files for the library code.  Support via GEnie, Internet (via
  22. GEnie), US Mail or phone from the author.
  23.  
  24.  
  25. REGISTRATION INFORMATION
  26.  
  27. The non-commercial registration fee for SG C Tools 1.4 is $10.00
  28. plus $3.00 for shipping in US funds.
  29.  
  30. Send a check or money order for the appropriate amount to:
  31.  
  32. Steve Goldsmith
  33. 2805 Jamaica Street
  34. Sarasota, FL 34231
  35.  
  36. Please indicate what product you are ordering and if you have a
  37. requirement for 3.5" media.  I normally ship 5.25" Commodore GCR
  38. format diskettes, but will furnish 3.5" media upon request.
  39. Customers outside of the United States and Canada should include an
  40. extra $5.00 for airmail.
  41.  
  42. If you are a registered user of this product and desire an update,
  43. please contact me for upgrade prices.
  44.  
  45.  
  46. DISTRIBUTION NOTICE
  47.  
  48. This is "user-supported" software.  You are hereby granted a
  49. license by Steve Goldsmith to distribute this evaluation copy of SG
  50. C Tools and its documentation, subject to the following conditions:
  51.  
  52. 1.   SG C Tools may be distributed freely without charge in
  53.      evaluation form only.
  54.  
  55. 2.   SG C Tools may not be sold, licensed, or a fee charged for its
  56.      use.  If a fee is charged in connection with SG C Tools, it
  57.      must cover the cost of copying or dissemination only.  Such
  58.      charges must be clearly identified as such by the originating
  59.      party.  Under no circumstances may the purchaser be given the
  60.      impression that he is buying SG C Tools itself.
  61.  
  62. 3.   SG C Tools must be presented as a complete unit, including
  63.      this documentation.   Neither SG C Tools nor its documentation
  64.      may be amended or altered in any way.
  65.  
  66. 4.   By granting you the right to distribute the evaluation form of
  67.      SG C Tools, you do not become the owner of SG C Tools in any
  68.      form.  Any other use, distribution or representation of SG C
  69.      Tools is expressly forbidden without the written consent of
  70.      Steve Goldsmith.
  71.  
  72. Commodore 128 is a trademark of Commodore Business Machines.  CP/M
  73. and CP/M 3.0 are trademarks of Digital Research.  MS-DOS and
  74. Windows are trademarks of Microsoft.  IBM PC,  PC-XT and PC-AT are
  75. trademarks of International Business Machines.
  76.  
  77.  
  78. OVERVIEW
  79.  
  80. SG C Tools ANSI C library unlocks the power of the C128 running
  81. CP/M!  High level and low level functions are included to access
  82. the VDC, SID and CIA.  All source code is compatible with the
  83. Freeware version of Hi Tech C.  A demo is included to show you how
  84. to use most features.
  85.  
  86.  
  87. REQUIREMENTS
  88.  
  89. A C128 or C128D running CP/M 3.0 or a IBM PC running a CP/M
  90. emulator and DOS to CP/M file transfer software.
  91.  
  92. At least one 1581, two 1571s, large RAM disk or hard drive to
  93. compile on a C128.
  94.  
  95. 80 column monitor for VDC specific routines.  640 X 480 interlace
  96. graphics requires a monitor that can handle this format.
  97.  
  98. ANSI C programming experience.
  99.  
  100.  
  101. MODIFICATIONS IN VERSION 1.4
  102.  
  103. Added Z Blaster engine to play 4 bit PCM encoded (.RAW) files.
  104.  
  105. Added PCX engines to view 640 X 200 X 2 and 640 X 480 X 2 images on
  106. the VDC.
  107.  
  108. Unregistered versions no longer include library source!
  109.  
  110.  
  111. COMPILING DEMO WITH HI-TECH C 3.09
  112.  
  113. First you will need to have a copy of HI-TECH C 3.09 (CP/M-80). 
  114. You can download the following Freeware files from GEnie's CP/M RT
  115. (M685;3) or other source:
  116.  
  117.  8149 LIBSRC.LZH               X BRIAN-CPM    930616   80384     39 
  118.  3
  119.       Desc: Source Code to Hitech C library
  120.  8148 Z80V309.LZH              X BRIAN-CPM    930616  194304     51 
  121.  3
  122.       Desc: Hitech C Compiler for CP/M
  123.  8147 Z80DOC.LZH               X BRIAN-CPM    930616   89088     55 
  124.  3
  125.       Desc: Documentation for Hitech C compiler
  126.  
  127. You should look over HI-TECH C's manual and compile a simple "hello
  128. world" program before proceeding.  I installed all the compiler
  129. related files on my 1581.  My source and header files are on a
  130. 1571.  You could get away with two 1571s, but a RAM disk or hard
  131. drive would be better.  You could also use a faster CP/M system or
  132. a Z80 emulator to edit and compile code.
  133.  
  134. To compile demo program use:
  135.  
  136. C -O -X DEMO.C -LC128
  137.  
  138.  
  139. PROGRAMMING CONSIDERATIONS
  140.  
  141. The VDC should be configured to its default CP/M 3.0 settings at
  142. the start and end of each program.
  143.  
  144. Display memory        0000h
  145. Attribute memory      0800h
  146. Character definitions 2000h
  147.  
  148. This includes restoring character definitions if you use memory at
  149. 2000h for bit maps, etc.  Setting the VDC to 64K mode wipes out
  150. memory used in 16K mode, so be sure to save the character
  151. definitions to a memory buffer or file before using 64K mode.  The
  152. VDC remains in 64K mode until you do a cold boot or warm boot with
  153. the C128's reset button.
  154.  
  155. Most of the VDC functions do not check parameters for range
  156. violations.  Range checking should be preformed at the application
  157. level.  There are times when you may want to write to a off screen
  158. memory location.  For this reason there is no need to waste time
  159. and code doing range checks.  Just be aware of the implications. 
  160. A renegade program may accidentally wipe out character definitions
  161. or other important memory regions forcing you to reboot.
  162.  
  163. Basically, just return to CP/M the way it was before your program
  164. ran.  See DEMO.C for a complete example of setting various VDC
  165. modes and exiting back to CP/M correctly.
  166.  
  167. CP/M relies on the CIAs for communication to the outside world just
  168. like in native 64/128 modes.  With this in mind it is best not to
  169. change certain registers.  I have found it safe to use CIA #2's TOD
  170. clock, timers A and B and disable all interrupt sources.  You can
  171. also safely read the keyboard and joy sticks via CIA #1 if you
  172. disable interrupts.  My low level key scan function reads all key
  173. positions into an array of 11 bytes.  See page 642 of the Commodore
  174. 128 Programmer's Reference for the key positions in the matrix. 
  175. You can tell joy stick signals from a key short because the joy
  176. stick shorts a whole row in the matrix instead of one bit like a
  177. key press.  See page 32 of the 1351 Mouse User's manual for more
  178. info.
  179.  
  180. CP/M uses voice 1 of the SID to produce a key click.  You can use
  181. the SID just as you would in native 128 mode with one exception. 
  182. Since CP/M writes to the SID during key presses it may affect a
  183. sound in progress.  You can disable interrupts to eliminate this
  184. problem.
  185.  
  186. The four bit Z Blaster engine requires the sound data's high
  187. nibbles to come first.  You can easily swap the nibbles once the
  188. sample is in memory if needed.  The maximum sample rate is about 15
  189. Khz.
  190.  
  191. The PCX engines for 640 X 200 and 640 X 480 require you to toggle
  192. off the disk status line.  The status line updates during disk I/O
  193. and changes the VDC update address which throws off the engines.
  194.  
  195.  
  196. HOW TO CONTACT ME
  197.  
  198. Please report any support questions, problems, suggestions, etc. to
  199. me via GEnie S.GOLDSMITH2, Internet S.GOLDSMITH2@GENIE.GEIS.COM,
  200. voice phone (813) 925-1064 or US Mail to:
  201.  
  202. Steve Goldsmith
  203. 2805 Jamaica Street
  204. Sarasota, FL 34231
  205. USA
  206.